#define MIvalid_range "valid_range"
#define MIvalid_max "valid_max"
#define MIvalid_min "valid_min"
-#define MI_FillValue "_FillValue"
+#define MI_FillValue "NC_FillValue"
#define MItitle "title"
#define MIhistory "history"
status = NC_NOERR;
if (std::string(arrayName).rfind("vtk", 0) > 0)
{
- // for an array that starts with vtk we don't specify _FillValue
+ // for an array that starts with vtk we don't specify NC_FillValue
switch (vtkType)
{
case VTK_CHAR:
if (fillValue != NC_FILL_INT)
{
unsigned char fillByte = fillValue;
- status = nc_put_att(ncid, attributeid, "_FillValue", NC_BYTE, 1, &fillByte);
+ status = nc_put_att(ncid, attributeid, "NC_FillValue", NC_BYTE, 1, &fillByte);
}
break;
case VTK_SHORT:
if (fillValue != NC_FILL_SHORT)
{
short fillShort = fillValue;
- status = nc_put_att_short(ncid, attributeid, "_FillValue", NC_SHORT, 1, &fillShort);
+ status = nc_put_att_short(ncid, attributeid, "NC_FillValue", NC_SHORT, 1, &fillShort);
}
break;
case VTK_INT:
if (fillValue != NC_FILL_INT)
{
- status = nc_put_att_int(ncid, attributeid, "_FillValue", NC_INT, 1, &fillValue);
+ status = nc_put_att_int(ncid, attributeid, "NC_FillValue", NC_INT, 1, &fillValue);
}
break;
case VTK_FLOAT:
if (fillValue != NC_FILL_INT)
{
float fillFloat = fillValue;
- status = nc_put_att_float(ncid, attributeid, "_FillValue", NC_FLOAT, 1, &fillFloat);
+ status = nc_put_att_float(ncid, attributeid, "NC_FillValue", NC_FLOAT, 1, &fillFloat);
}
break;
case VTK_DOUBLE:
if (fillValue != NC_FILL_INT)
{
double fillDouble = fillValue;
- status = nc_put_att_double(ncid, attributeid, "_FillValue", NC_DOUBLE, 1, &fillDouble);
+ status = nc_put_att_double(ncid, attributeid, "NC_FillValue", NC_DOUBLE, 1, &fillDouble);
}
break;
default:
if (status)
{
std::ostringstream ostr;
- ostr << "Error nc_put_att_xxx " << arrayName << ":_FillValue: " << nc_strerror(status);
+ ostr << "Error nc_put_att_xxx " << arrayName << ":NC_FillValue: " << nc_strerror(status);
throw std::runtime_error(ostr.str());
}
}
// Check for a fill value.
size_t attribLength;
- if ((nc_inq_attlen(ncFD, varId, "_FillValue", &attribLength) == NC_NOERR) && (attribLength == 1))
+ if ((nc_inq_attlen(ncFD, varId, "NC_FillValue", &attribLength) == NC_NOERR) && (attribLength == 1))
{
if (this->ReplaceFillValueWithNan)
{
if (dataArray->GetDataType() == VTK_FLOAT)
{
float fillValue;
- nc_get_att_float(ncFD, varId, "_FillValue", &fillValue);
+ nc_get_att_float(ncFD, varId, "NC_FillValue", &fillValue);
std::replace(reinterpret_cast<float*>(dataArray->GetVoidPointer(0)),
reinterpret_cast<float*>(dataArray->GetVoidPointer(dataArray->GetNumberOfTuples())),
fillValue, static_cast<float>(vtkMath::Nan()));
else if (dataArray->GetDataType() == VTK_DOUBLE)
{
double fillValue;
- nc_get_att_double(ncFD, varId, "_FillValue", &fillValue);
+ nc_get_att_double(ncFD, varId, "NC_FillValue", &fillValue);
std::replace(reinterpret_cast<double*>(dataArray->GetVoidPointer(0)),
reinterpret_cast<double*>(dataArray->GetVoidPointer(dataArray->GetNumberOfTuples())),
fillValue, vtkMath::Nan());
///@{
/**
- * If on, any float or double variable read that has a _FillValue attribute
+ * If on, any float or double variable read that has a NC_FillValue attribute
* will have that fill value replaced with a not-a-number (NaN) value. The
* advantage of setting these to NaN values is that, if implemented properly
* by the system and careful math operations are used, they can implicitly be
if (this->NodesPerFace > 3) // may be mixed mesh
{
if (!this->CheckError(
- nc_get_att(this->NcId, this->FaceVarId, "_FillValue", &this->FaceFillValue)))
+ nc_get_att(this->NcId, this->FaceVarId, "NC_FillValue", &this->FaceFillValue)))
{
- vtkErrorMacro("_FillValue attribute missing - The connectivity variable has to specify a "
- "_FillValue attribute because it has more than 3 nodes per face");
+ vtkErrorMacro("NC_FillValue attribute missing - The connectivity variable has to specify a "
+ "NC_FillValue attribute because it has more than 3 nodes per face");
return false;
}
}
if (replaceFill && (std::is_same<T, float>::value || std::is_same<T, double>::value))
{
T fillValue{};
- if (nc_get_att(NcId, var, "_FillValue", &fillValue) != NC_NOERR)
+ if (nc_get_att(NcId, var, "NC_FillValue", &fillValue) != NC_NOERR)
{
vtkDebugWithObjectMacro(output, "No fill value defined");
return;
///@{
/**
- * If on, any float or double variable read that has a _FillValue attribute
+ * If on, any float or double variable read that has a NC_FillValue attribute
* will have that fill value replaced with a not-a-number (NaN) value. The
* advantage of setting these to NaN values is that, if implemented properly
* by the system and careful math operations are used, they can implicitly be
vals[0] = 0; /* fill value */
/* create attribute to cause variable to fill with zeros per routine spec
*/
- if ((status = nc_put_att_longlong(exoid, propid, _FillValue, int_type, 1, vals)) != NC_NOERR) {
+ if ((status = nc_put_att_longlong(exoid, propid, NC_FillValue, int_type, 1, vals)) != NC_NOERR) {
snprintf(errmsg, MAX_ERR_LENGTH,
"ERROR: failed to create property name fill attribute in file id %d", exoid);
ex_err_fn(exoid, __func__, errmsg, status);
/* create attribute to cause variable to fill with zeros per routine spec
*/
- if ((status = nc_put_att_longlong(exoid, propid, _FillValue, int_type, 1, vals)) != NC_NOERR) {
+ if ((status = nc_put_att_longlong(exoid, propid, NC_FillValue, int_type, 1, vals)) != NC_NOERR) {
snprintf(errmsg, MAX_ERR_LENGTH,
"ERROR: failed to create property name fill attribute in file id %d", exoid);
ex_err_fn(exoid, __func__, errmsg, status);